package com.alex.tinyurl.service.store.db.entity;

import lombok.Getter;
import lombok.Setter;

/**
 * URL映射存储实体
 */
@Getter
@Setter
public class UrlMappingEntity {

    private String originalUrl;
    private String tinyUrl;

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("UrlMappingEntity{");
        sb.append("originalUrl='").append(originalUrl).append('\'');
        sb.append(", tinyUrl='").append(tinyUrl).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public static UrlMappingEntity getInstance(String tinyUrl, String originalUrl) {
        UrlMappingEntity ret = new UrlMappingEntity();
        ret.setOriginalUrl(originalUrl);
        ret.setTinyUrl(tinyUrl);
        return ret;
    }
}
